package com.rpc.provider.manager;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 调用对象管理者
 */
public class RPCInvokeTargetManager {
    private static Map<String, Object> invokeTargetMapper = new ConcurrentHashMap<>();

    public static void addInvokeTarget(String interfaceName, Object target) {
        invokeTargetMapper.put(interfaceName, target);
    }

    public static Object getInvokeTarget(String interfaceName) {
        return invokeTargetMapper.getOrDefault(interfaceName, null);
    }
}
